 <include file="application/home/view/public/header.html"/>
<link rel="stylesheet" href="__PUBLIC__/home/js/fuelux/fuelux.css" type="text/css" cache="false">
      <!-- /.aside -->
      <section id="content">
        <section class="vbox">
          <section class="scrollable padder">
             <header class="header bg-light bg-gradient b-b">
            <p>首页</p>
          </header>
          	<section class="panel panel-default">
                
				<div class="panel panel-default">
              <div class="wizard clearfix" id="form-wizard">
                <ul class="steps">
                  <li data-target="#step1" class="active"><span class="badge badge-info">1</span>转入会员账户 1</li>
                  <li data-target="#step2"><span class="badge">2</span>选择货币类型 2</li>
                  <li data-target="#step3"><span class="badge">3</span>输入转账金额 3</li>
                </ul>
              </div>
              <div class="step-content">
                <form>
                  <div class="step-pane active" id="step1">
                    <p>账户名 :</p>
                    <input type="text" class="form-control" data-trigger="change" data-required="true"placeholder="输入转账用户名" id="username">
                    <br />
                    <button id="genpassword"  class="btn btn-s-md btn-success btn-rounded " onClick="checkout_user()" type="button">验证</button>
                  </div>
                  <div class="step-pane" id="step2">
                    <p>选择货币类型:</p>
                   <select class="form-control" id="type" name="type" data-required="true">
		  				<option value="" selected="selected">--请选择--</option>
						<foreach name="aa" item="va">
							<option value="{$va['id']}" data-name="{$va.name}" data-jifen="{$va.num}">{$va['name']}</option>
						</foreach>
					</select>
					<br />
					<p>该币种可用余额:</p>
					<input type="text" class="form-control" data-trigger="change" id='yue' name="assect" disabled>
                  </div>
                  <div class="step-pane" id="step3">
                  	<p>输入转账金额:</p>
					<input type="text" class="form-control" data-trigger="change" id="money" data-required="true" >
                  </div>
                </form>
                <div class="actions m-t">
                  <button type="button" class="btn btn-default btn-sm btn-prev" data-target="#form-wizard" data-wizard="previous" disabled="disabled">上一步</button>
                  <button type="button" class="btn btn-default btn-sm btn-next" data-target="#form-wizard" data-wizard="next" data-last="转账" id="stu" onclick="stu()">下一步</button>
                </div>
              </div>
            </div>
            <header class="panel-heading">转账记录</header>
            <div class="table-responsive">
                <table class="table table-striped b-t b-light text-sm">
                  <thead>
                    <tr>
                      <th>积分</th>
                      <th>交易记录内容</th>
                      <th>金额</th>
                      <th>时间</th>
                      <th>收益类型</th>
                    </tr>
                  </thead>
                  <tbody>
                    <foreach name="finance" item="vf">
                    <tr>
                      <td>{$vf.jifen}</td>
                      <td>{$vf.content}</td>
                      <td>{$vf.money}</td>
                      <td>{$vf.add_time|date='Y-m-d H:i:s',###}</td>
                      <td>
                      	<eq name="vf.money_type" value='1'>收入<else/>支出</eq>
                      </td>
                    </tr>
                    </foreach>
                  </tbody>
                </table>
              </div>
              <footer class="panel-footer">
                <div class="row">
                  <div class="col-sm-4 hidden-xs">
                  <!--  这里不可以删掉 -->
                  </div>
                  <div class="col-sm-4 text-center">  </div>
                  <div class="col-sm-4 text-right text-center-xs">
                    <ul class="pagination pagination-sm m-t-none m-b-none">
                      <li>{$page}</li>
                    </ul>
                  </div>
                </div>
              </footer>
           	</section>
          </section>
        </section>
        <a href="#" class="hide nav-off-screen-block" data-toggle="class:nav-off-screen" data-target="#nav"></a> </section>
      <aside class="bg-light lter b-l aside-md hide" id="notes">
        <div class="wrapper">Notification</div>
      </aside>
    </section>
  </section>
</section>
<script src="__PUBLIC__/home/js/app.v2.js"></script> <!-- Bootstrap --> <!-- App --> 
<script src="__PUBLIC__/home/js/charts/easypiechart/jquery.easy-pie-chart.js" cache="false"></script>
<script src="__PUBLIC__/home/js/charts/sparkline/jquery.sparkline.min.js" cache="false"></script> 
<script src="__PUBLIC__/home/js/charts/flot/jquery.flot.min.js" cache="false"></script> 
<script src="__PUBLIC__/home/js/charts/flot/jquery.flot.tooltip.min.js" cache="false"></script> 
<script src="__PUBLIC__/home/js/charts/flot/jquery.flot.resize.js" cache="false"></script> 
<script src="__PUBLIC__/home/js/charts/flot/jquery.flot.grow.js" cache="false"></script> 
<script src="__PUBLIC__/home/js/charts/flot/demo.js" cache="false"></script> 
<script src="__PUBLIC__/home/js/calendar/bootstrap_calendar.js" cache="false"></script> 
<script src="__PUBLIC__/home/js/calendar/demo.js" cache="false"></script> 
<script src="__PUBLIC__/home/js/sortable/jquery.sortable.js" cache="false"></script>
<script src="__PUBLIC__/js/layer/layer.js" type="text/javascript"></script>
<script src="__PUBLIC__/home/js/fuelux/fuelux.js" cache="false"></script>
<script src="__PUBLIC__/home/js/parsley/parsley.min.js" cache="false"></script>
</body>
</html>	
<script type="text/javascript">
//这里是加载layer.prompt方法 layer.prompt方法属于扩展函数  不会自动加载    所有需要手动调用 
	layer.config({
				path: '__PUBLIC__/js/layer/', //layer.js所在的目录，可以是绝对目录，也可以是相对目录
				extend: 'extend/layer.ext.js'
			});
//验证是否有会员
	function checkout_user(){
		var account = $('#username').val();
		if(account == ''){
			layer.msg('请输入用户名');
			return;
		}
		var url = "{:U('Pay/checkout_user')}"
		$.post(url,{'account':account},function(data){
			
			layer.msg(data.info);
		})
	}

	$("#type").change(function(){
			var t_name = $('#type option:selected').attr("data-name");
			var t_jifen = $('#type option:selected').attr("data-jifen");
			$('#ass').html(t_name+': <span class="mandatory">*</span>');
		 	$("[name='assect']").val(t_jifen);
	});
	function stu(){
		var aa=$("#stu").html();
		if (aa == '转账') {
			var username = $('#username').val();
			var type = $('#type').val();
			var money = $('#money').val();
			var yue = $('#yue').val();
			//alert(yue);
			//alert(money);
			if(username == '' || type=='' || money=='' || yue==''){
				layer.msg('请补全信息');
				return;
			}
  				layer.prompt({title: '输入交易密码，并确认', formType: 1}, 
  					function(pass, index){
  					var pwd = pass;
 					layer.close(index);
					var url = "{:U('Pay/transfer_add')}"
						$.post(url,{'account':username,'money':money,'pwd':pwd,'type':type},function(data){
							layer.msg(data.info);
							if(data.status==1){
								setTimeout(function(){  //使用  setTimeout（）方法设定定时2000毫秒
									window.location.reload();//页面刷新
								},2000);
							}
						
						});
				});
			
		}
		
	}
</script>
